package transaction.lcn.storage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import transaction.lcn.common.entity.Result;
import transaction.lcn.storage.service.StorageService;

import java.sql.SQLException;

@RequestMapping("/lcn/storage")
@RestController
public class StorageController {

    @Autowired
    StorageService storageService;

    @GetMapping(value = "/deduct")
    public Result deduct(@RequestParam String commodityCode, @RequestParam Integer orderCount) throws SQLException {
        storageService.deduct(commodityCode, orderCount);
        return new Result();
    }


}
